class GoodsList{

  final List<GoodItem> list;

  GoodsList(this.list);
  factory GoodsList.fromJson(List<dynamic> itemlist){
    return GoodsList(
      itemlist.map((item) => GoodItem.fromJson(item)).toList(),
    );
  }
}

class GoodItem {
  final int commodityId;
  final String name;
  final String intro;
  final double money;
  final int viewCount;
  final String imgurl1;
  final String type;

  GoodItem({
    this.commodityId,
    this.name,
    this.intro,
    this.money,
    this.imgurl1,
    this.type,
    this.viewCount,
  });

  factory GoodItem.fromJson(dynamic item){
    return GoodItem(
      commodityId: item['commodityId'],
      name: item['name'],
      intro: item['intro'],
      money: item['money'],
      imgurl1: item['imgurl1'],
      type: item['type'],
      viewCount: item['viewCount'],
    );
  }
}
